import json

from login_test import *

base_url = r'https://cloud.huaxiaerp.com'
url_retail_add = base_url + r'/jshERP-boot/depotHead/addDepotHeadAndDetail'
# 构造数据
# ---- 动态数据 ----
number = 'LSCK00000000825'
accountId = 11902  # 账户名
id = 17050534866660885805

null = ''

info_dict = {
    "operTime ": "2024-01-16 23:27:35 ", "number ": number,
    "payType ": "现付 ", "changeAmount ": "1000.00 ", "getAmount ": "1000.00 ",
    "backAmount ": 0, "accountId ": 29, "type ": "出库 ", "subType ": "零售 ",
    "defaultNumber ": number, "totalPrice ": 1000, "fileName ": " ", "status ": "0 "
}
info_str = json.dumps(info_dict)


rows_dict = [{"id ": "17054188553680390012 ", "name ": "散粉 ", "standard ": " ", "model ": " ", "color ": " ",
              "materialOther ": " ", "stock ": 190, "unit ": "g ", "snList ": " ", "batchNumber ": " ",
              "expirationDate ": " ", "sku ": " ", "operNumber ": "10 ", "unitPrice ": 100, "allPrice ": 1000,
              "remark ": " ", "orderNum ": 1, "depotId ": "20 ", "barCode ": "1020 "}]
rows_str = json.dumps(rows_dict)

data_retail_add = {
    'info': info_str,
    'rows': rows_str
}

# 发送请求
resp = requests.post(url_retail_add, headers=headers, json=data_retail_add, verify=False)
# 获取响应
print(resp.text)
